import axios from "axios"
import { Message } from "vant";
import router from '@/router';

const state = {
    goods: 123
}
const mutations = {
    SET_GOODS(state, payload) {
        state.goods = payload;
    },
}

const actions = {
    
    getGoods(context,payload) {
        //请求数据
        axios({
            url: "http://192.168.10.143:3000/goods",
            method: "get",
            params:payload,
        }).then((res) => {
            console.log(res,"reslogin")
            // if (res.data.tabs === 'diaogan') {
                context.commit("SET_GOODS", res.data[0]);
               
            // }
        })
    }
};


export default {
    namespaced: true,
    state,
    mutations,
    actions,
}